Lua Vector
Re: Lua Vector
Well it it does the same check 2 times so that should be removed. But I was referring to the fact that it generates new strings while calling asserts - there should be constant strings only (or an entirely different solution). It's not wrong to perform error checking because overhead is small, but for trivial operations like vector additions it constitutes a very significant fraction of overall performance. Given that it's something usually used in high volume, it adds up fast. With my own library, I would perform this check one time where performance isn't critical, and then put effort into writing code where such errors will never occur to begin with, so there would be no need to check against them on every single operation.
Re: Lua Vector
I should add, that I profiled my code for a simple racing game. First I used hump.vector After 10 seconds of profiling, there have been 50'000 calls to "isvector", which occupies 0.5 sec of CPU time, compared to 2 sec of total time. So I decided to switch to hump.vector-light and I saved 25% of CPU time.
Re: Lua Vector
Can i have the documentation for this, if you have, i really need it...
Please
Who is online
Users browsing this forum: No registered users and 4 guests