kelly / node-i2c

Node.js native bindings for i2c-dev. Plays well with Raspberry Pi and Beaglebone.
Other
216 stars 91 forks source link

Require slow due to coffee (v0.1.8) #60

Closed gfduszynski closed 9 years ago

gfduszynski commented 9 years ago

I'm using CORE9G25@400MHz module with node-i2c. Require call to node-i2c (v0.1.8) takes about ~4100ms, out of which nested require to coffee-script takes about ~1900ms and compiling also about 2s.

Switching to JS would provide massive reduction in startup time.

kelly commented 9 years ago

It's a single coffeescript file, so just run coffee -c i2c.coffee to compile to js.

gfduszynski commented 9 years ago

This solution still leaves the dependency to 'coffee-script'. Plus it's a thing that no one would like to have in a build job :smile:

kelly commented 9 years ago

You can fork it too. Most people using this module aren't running it on a 400MHZ cpu. If that changes, I'll look into modifying the code.